#include <iostream>
#include <queue>

using namespace std;

//大根堆，大小为k
//如果新插入的节点大于堆顶元素，就无法插入
int n, m, k;
priority_queue<int> heap;

int main()
{
	cin >> n >> m >> k;
	for(int i = 1; i <= n; i++)
	{
		int x; cin >> x;
		heap.push(x);
		if(heap.size() > k) heap.pop();
	}

	while(m--)
	{
		int op; cin >> op;
		if(op == 1)
		{
			int x; cin >> x;
			heap.push(x);
			if(heap.size() > k) heap.pop();
		}
		else if(op == 2)
		{
			if(heap.size() == k) cout << heap.top() << endl;
			else cout << -1 << endl;
		}
	}

	return 0;
}

